import {RouteRecordRaw} from 'vue-router'

// Work
import AsnReceive from '../lib/pages/work/AsnReceive.vue'
import Collect from '../lib/pages/work/Collect.vue'
import InvLocList from '../lib/pages/work/InvLocList.vue'
import PickOrder from '../lib/pages/work/PickOrder.vue'
import LoadingUp from '../lib/pages/work/LoadingUp.vue'
import LoadingUpPallet from '../lib/pages/work/LoadingUpPallet.vue'
import MoveWithNote from '../lib/pages/work/MoveWithNote.vue'
import MoveWithoutNote from '../lib/pages/work/MoveWithoutNote.vue'
import PackConsolidate from '../lib/pages/work/PackConsolidate.vue'
import PackLabeling from '../lib/pages/work/PackLabeling.vue'
import Pallet from '../lib/pages/work/Pallet.vue'
import Pick from '../lib/pages/work/Pick.vue'
import WholeLpnMove from 'src/lib/pages/work/WholeLpnMove.vue'

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    component: () => import('layouts/MainLayout.vue'),
    children: [
      {name: 'index', path: '', component: () => import('pages/IndexPage.vue')},
      {
        name: '/wms/work/whole-lpn-move-by-pda',
        path: '/wms/work/whole-lpn-move-by-pda',
        component: WholeLpnMove,
        meta: {needRight: 'Wms.Work.Other.WholeLpnMove'},
      },
      {
        name: '/wms/work/qc',
        path: '/wms/work/qc',
        component: () => import('../lib/pages/work/Qc.vue'),
        meta: {needRight: 'Wms.Work.Order.PackQc'},
      },
      {
        name: '/wms/work/counting',
        path: '/wms/work/counting',
        component: () => import('../lib/pages/work/Counting.vue'),
        meta: {needRight: 'Wms.Inv.InvCounting.DoCounting'},
      },
      {
        name: '/wms/work/recounting',
        path: '/wms/work/recounting',
        component: () => import('../lib/pages/work/Recounting.vue'),
        meta: {needRight: 'Wms.Inv.InvCounting.DoCounting'},
      },
      {
        name: '/wms/work/asn-arrived',
        path: '/wms/work/asn-arrived',
        component: () => import('../lib/pages/work/AsnArrived.vue'),
        meta: {needRight: 'Wms.Work.Asn.Arrived'},
      },
      {
        name: '/wms/work/asn-checked',
        path: '/wms/work/asn-checked',
        component: () => import('../lib/pages/work/AsnChecked.vue'),
        meta: {needRight: 'Wms.Work.Asn.Checked'},
      },
      {
        name: '/wms/work/putaway',
        path: '/wms/work/putaway',
        component: () => import('../lib/pages/work/Putaway.vue'),
        meta: {needRight: 'Wms.Work.Other.Putaway'},
      },
      // Foundation
      {
        name: '/comm/my/my-profile',
        path: '/comm/my/my-profile',
        component: () => import('pages/my/MyProfile.vue'),
      },
      {
        name: '/comm/cfg/about',
        path: '/comm/cfg/about',
        component: () => import('pages/cfg/About.vue'),
      },
      // Config
      {
        name: '/wms/cfg/pda-config',
        path: '/wms/cfg/pda-config',
        component: () => import('../lib/pages/cfg/PdaConfig.vue'),
        meta: {needLogin: false},
      },
      // Work
      {
        name: '/wms/work/asn-receive',
        path: '/wms/work/asn-receive',
        component: AsnReceive,
        meta: {needRight: 'Wms.Work.Asn.ReceiveGoods'},
      },
      {
        name: '/wms/work/collect',
        path: '/wms/work/collect',
        component: Collect,
        meta: {needRight: 'Wms.Work.Order.Collect'},
      },
      {
        name: '/wms/work/loc',
        path: '/wms/work/loc',
        component: InvLocList,
        meta: {needRight: 'Wms.Inv.Inventory.View'},
      },
      {
        name: '/wms/work/pick-order',
        path: '/wms/work/pick-order',
        component: PickOrder,
        meta: {needRight: 'Wms.Work.Order.Pick'},
      },
      {
        name: '/wms/work/loading-up',
        path: '/wms/work/loading-up',
        component: LoadingUp,
        meta: {needRight: 'Wms.Work.Order.LoadingUp'},
      },
      {
        name: '/wms/work/loading-up-pallet',
        path: '/wms/work/loading-up-pallet',
        component: LoadingUpPallet,
        meta: {needRight: 'Wms.Work.Order.LoadingUp'},
      },
      {
        name: '/wms/work/move-with-note',
        path: '/wms/work/move-with-note',
        component: MoveWithNote,
        meta: {needRight: 'Wms.Inv.InvMove.Operate'},
      },
      {
        name: '/wms/work/move-without-note',
        path: '/wms/work/move-without-note',
        component: MoveWithoutNote,
        meta: {needRight: 'Wms.Inv.InvMove.Operate'},
      },
      {
        name: '/wms/work/pack-consolidate',
        path: '/wms/work/pack-consolidate',
        component: PackConsolidate,
        meta: {needRight: 'Wms.Work.Order.PackConsolidate'},
      },
      {
        name: '/wms/work/pack-labeling',
        path: '/wms/work/pack-labeling',
        component: PackLabeling,
        meta: {needRight: 'Wms.Work.Order.PackLabeling'},
      },
      {
        name: '/wms/work/pallet',
        path: '/wms/work/pallet',
        component: Pallet,
        meta: {needRight: 'Wms.Work.Order.DoPallet'},
      },
      {
        name: '/wms/work/pick',
        path: '/wms/work/pick',
        component: Pick,
        meta: {needRight: 'Wms.Work.Order.Pick'},
      },
    ],
  },
  {
    path: '/',
    component: () => import('layouts/CenterBoxLayout.vue'),
    children: [
      {
        name: '/comm/auth/login',
        path: '/comm/auth/login',
        component: () => import('pages/auth/Login.vue'),
        meta: {needLogin: false},
      },
      {
        name: '/comm/auth/forgot-password',
        path: '/comm/auth/forgot-password',
        component: () => import('@njt/foundation/pages/auth/ForgotPassword.vue'),
        meta: {needLogin: false},
      },
      {
        name: '/comm/auth/reset-password',
        path: '/comm/auth/reset-password',
        component: () => import('@njt/foundation/pages/auth/ResetPassword.vue'),
        meta: {needLogin: false},
      },
      {
        name: '/comm/auth/renew-password',
        path: '/comm/auth/renew-password',
        component: () => import('@njt/foundation/pages/auth/ResetPassword.vue'),
        meta: {needLogin: false},
      },
      {
        name: '/comm/auth/set-password-first-time',
        path: '/comm/auth/set-password-first-time',
        component: () => import('@njt/foundation/pages/auth/ResetPassword.vue'),
        meta: {needLogin: false},
      },
      {
        name: '/comm/auth/change-password',
        path: '/comm/auth/change-password',
        component: () => import('@njt/foundation/pages/auth/ChangePassword.vue'),
      },

    ],
  },

  // Always leave this as last one,
  // but you can also remove it
  {
    path: '/:catchAll(.*)*',
    component: () => import('@njt/foundation/pages/sys/Error404.vue'),
  },
]

export default routes
